<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>ParseNodeHolder</title>
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ParseNodeHolder";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/lang/ParseNode.SubTreeIterator.html" title="class in mmj.lang"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/lang/ParseNodeHolder.html" target="_top">Frames</a></li>
<li><a href="ParseNodeHolder.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">mmj.lang</div>
<h2 title="Class ParseNodeHolder" class="title">Class ParseNodeHolder</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>mmj.lang.ParseNodeHolder</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">ParseNodeHolder</span>
extends java.lang.Object</pre>
<div class="block">ParseNodeHolder is either really dumb or just kinda dumb.
 <p>
 The idea is that an Expression to be parsed can be rewritten as an array of
 ParseNodeHolders, with the original Sym's stored in ParseNodeHolder.mObj.
 Then The Var's can be replaced with their VarHyp's, with mObj set to the
 VarHyp and also stored in parseNode. Subsequently the array of
 ParseNodeHolders can be rewritten, and rewritten until, at last, every mObj
 containing a Cnst has been parsed -- and there is only one item in the array
 whose parseNode is the root of a parse tree.
 <p>
 Anyway, ParseNodeHolder is very popular in mmj.verify. Grammar. Many uses!
 Haha.
 <p>
 In EarleyParser the need arose to maintain a linked list of ParseNodeHolders
 instead of an array, so, what the heck, twinFwd and twinBwd were added (I was
 so happy, why not!) The problem was that in an ambiguous grammar, many valid
 parse trees can exist, and you don't know where you will first notice them;
 they might be found at a bottom sub-tree and then propagate upward. So,
 infinite parse trees are feasible, thanks to adding linked lists of'
 ParseNodeHolder. <:-)</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#bwd">bwd</a></strong></code>
<div class="block">Backward reference in chain of ParseNodeHolders.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#fwd">fwd</a></strong></code>
<div class="block">Forward reference in chain of ParseNodeHolders.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/MObj.html" title="class in mmj.lang">MObj</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#mObj">mObj</a></strong></code>
<div class="block">mObj contains either a Cnst, a Var or a Stmt.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#parseNode">parseNode</a></strong></code>
<div class="block">ParseNode associated with mObj, may be null.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#ParseNodeHolder()">ParseNodeHolder</a></strong>()</code>
<div class="block">Default constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#ParseNodeHolder(mmj.lang.Cnst)">ParseNodeHolder</a></strong>(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;cnst)</code>
<div class="block">Constructor -- input is Cnst, so no ParseNode available, just load the
 MObj for use in ParseTree generation...</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#ParseNodeHolder(mmj.lang.ParseNode)">ParseNodeHolder</a></strong>(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;parseNode)</code>
<div class="block">Constructor -- input is a ParseNode, so derive MObj from the input
 ParseNode.stmt.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#ParseNodeHolder(mmj.lang.VarHyp)">ParseNodeHolder</a></strong>(<a href="../../mmj/lang/VarHyp.html" title="class in mmj.lang">VarHyp</a>&nbsp;varHyp)</code>
<div class="block">Constructor -- input is VarHyp so create default VarHyp ParseNode.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#addToTwinChain(mmj.lang.ParseNodeHolder)">addToTwinChain</a></strong>(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>&nbsp;x)</code>
<div class="block">Add a node to a ParseNodeHolder's twin chain.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#buildRuleFormatExpr(mmj.lang.ParseNodeHolder[])">buildRuleFormatExpr</a></strong>(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]&nbsp;parseNodeHolderExpr)</code>
<div class="block">A tedious conversion.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#dumpTwinChainToString()">dumpTwinChainToString</a></strong>()</code>
<div class="block">Copy "twin chain" to string for diagnostic use.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#getCnstIdOrLabel()">getCnstIdOrLabel</a></strong>()</code>
<div class="block">return Cnst or Label of ParseNode.stmt.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a></code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#getCnstOrTyp()">getCnstOrTyp</a></strong>()</code>
<div class="block">return Cnst or Type Code of ParseNode.stmt.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../mmj/lang/ParseNodeHolder.html#initTwinChain()">initTwinChain</a></strong>()</code>
<div class="block">Init twin chain, first node points to itself.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="mObj">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mObj</h4>
<pre>public&nbsp;<a href="../../mmj/lang/MObj.html" title="class in mmj.lang">MObj</a> mObj</pre>
<div class="block">mObj contains either a Cnst, a Var or a Stmt.</div>
</li>
</ul>
<a name="parseNode">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseNode</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a> parseNode</pre>
<div class="block">ParseNode associated with mObj, may be null.</div>
</li>
</ul>
<a name="fwd">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fwd</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a> fwd</pre>
<div class="block">Forward reference in chain of ParseNodeHolders. Used only in rare, local
 circumstances, such as EarleyParser tree building. When there is only one
 item in the chain set fwd = bwd = this;</div>
</li>
</ul>
<a name="bwd">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>bwd</h4>
<pre>public&nbsp;<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a> bwd</pre>
<div class="block">Backward reference in chain of ParseNodeHolders. Used only in rare, local
 circumstances, such as EarleyParser tree building. When there is only one
 item in the chain set fwd = bwd = this;</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="ParseNodeHolder()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ParseNodeHolder</h4>
<pre>public&nbsp;ParseNodeHolder()</pre>
<div class="block">Default constructor.</div>
</li>
</ul>
<a name="ParseNodeHolder(mmj.lang.ParseNode)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ParseNodeHolder</h4>
<pre>public&nbsp;ParseNodeHolder(<a href="../../mmj/lang/ParseNode.html" title="class in mmj.lang">ParseNode</a>&nbsp;parseNode)</pre>
<div class="block">Constructor -- input is a ParseNode, so derive MObj from the input
 ParseNode.stmt.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parseNode</code> - the input ParseNode</dd></dl>
</li>
</ul>
<a name="ParseNodeHolder(mmj.lang.Cnst)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ParseNodeHolder</h4>
<pre>public&nbsp;ParseNodeHolder(<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;cnst)</pre>
<div class="block">Constructor -- input is Cnst, so no ParseNode available, just load the
 MObj for use in ParseTree generation...</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>cnst</code> - the input Cnst</dd></dl>
</li>
</ul>
<a name="ParseNodeHolder(mmj.lang.VarHyp)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ParseNodeHolder</h4>
<pre>public&nbsp;ParseNodeHolder(<a href="../../mmj/lang/VarHyp.html" title="class in mmj.lang">VarHyp</a>&nbsp;varHyp)</pre>
<div class="block">Constructor -- input is VarHyp so create default VarHyp ParseNode.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>varHyp</code> - the input VarHyp</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="buildRuleFormatExpr(mmj.lang.ParseNodeHolder[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildRuleFormatExpr</h4>
<pre>public static&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>[]&nbsp;buildRuleFormatExpr(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>[]&nbsp;parseNodeHolderExpr)</pre>
<div class="block">A tedious conversion.
 <p>
 Converts to "ruleFormatExpr" -- each item in the Cnst array is a
 grammaticl Type Code or a Cnst.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>parseNodeHolderExpr</code> - array of ParseNodeHolder.</dd>
<dt><span class="strong">Returns:</span></dt><dd>ruleFormatExpr version of ParseNodeHolder array.</dd></dl>
</li>
</ul>
<a name="getCnstOrTyp()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCnstOrTyp</h4>
<pre>public&nbsp;<a href="../../mmj/lang/Cnst.html" title="class in mmj.lang">Cnst</a>&nbsp;getCnstOrTyp()</pre>
<div class="block">return Cnst or Type Code of ParseNode.stmt.
 <p>
 If mObj is a Cnst, return it, otherwise return the Type Code of
 parseNode.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>cnst Cnst or Type Code.</dd></dl>
</li>
</ul>
<a name="getCnstIdOrLabel()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCnstIdOrLabel</h4>
<pre>public&nbsp;java.lang.String&nbsp;getCnstIdOrLabel()</pre>
<div class="block">return Cnst or Label of ParseNode.stmt.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>String Cnst.id if mObj is Cnst, else label of
         parseNodeHolder.stmt.</dd></dl>
</li>
</ul>
<a name="dumpTwinChainToString()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dumpTwinChainToString</h4>
<pre>public&nbsp;java.lang.String&nbsp;dumpTwinChainToString()</pre>
<div class="block">Copy "twin chain" to string for diagnostic use.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>String representing twin chain.</dd></dl>
</li>
</ul>
<a name="initTwinChain()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initTwinChain</h4>
<pre>public&nbsp;void&nbsp;initTwinChain()</pre>
<div class="block">Init twin chain, first node points to itself.</div>
</li>
</ul>
<a name="addToTwinChain(mmj.lang.ParseNodeHolder)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>addToTwinChain</h4>
<pre>public&nbsp;void&nbsp;addToTwinChain(<a href="../../mmj/lang/ParseNodeHolder.html" title="class in mmj.lang">ParseNodeHolder</a>&nbsp;x)</pre>
<div class="block">Add a node to a ParseNodeHolder's twin chain.
 <p>
 Inserts at the front of the list.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - the node to add</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../mmj/lang/ParseNode.SubTreeIterator.html" title="class in mmj.lang"><span class="strong">Prev Class</span></a></li>
<li><a href="../../mmj/lang/ParseTree.html" title="class in mmj.lang"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?mmj/lang/ParseNodeHolder.html" target="_top">Frames</a></li>
<li><a href="ParseNodeHolder.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
